home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / getmntent.z / getmntent
Encoding:
Text File  |  2002-10-03  |  5.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTMMMMNNNNTTTTEEEENNNNTTTT((((3333))))                                                      GGGGEEEETTTTMMMMNNNNTTTTEEEENNNNTTTT((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      setmntent, getmntent, addmntent, getmntany, endmntent, hasmntopt - get
  10.      file system descriptor file entry
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<mmmmnnnntttteeeennnntttt....hhhh>>>>
  15.  
  16.      FFFFIIIILLLLEEEE ****sssseeeettttmmmmnnnntttteeeennnntttt((((cccchhhhaaaarrrr ****ffffiiiilllleeeepppp,,,, cccchhhhaaaarrrr ****ttttyyyyppppeeee))));;;;
  17.  
  18.      ssssttttrrrruuuucccctttt mmmmnnnntttteeeennnntttt ****ggggeeeettttmmmmnnnntttteeeennnntttt((((FFFFIIIILLLLEEEE ****ffffiiiilllleeeepppp))));;;;
  19.  
  20.      iiiinnnntttt aaaaddddddddmmmmnnnntttteeeennnntttt((((FFFFIIIILLLLEEEE ****ffffiiiilllleeeepppp,,,, ssssttttrrrruuuucccctttt mmmmnnnntttteeeennnntttt ****mmmmnnnntttt))));;;;
  21.  
  22.      iiiinnnntttt ggggeeeettttmmmmnnnnttttaaaannnnyyyy ((((FFFFIIIILLLLEEEE ****ffffiiiilllleeeepppp,,,, ssssttttrrrruuuucccctttt mmmmnnnntttteeeennnntttt ****mmmmpppp,,,, ssssttttrrrruuuucccctttt mmmmnnnntttteeeennnntttt ****mmmmpppprrrreeeeffff))));;;;
  23.  
  24.      cccchhhhaaaarrrr ****hhhhaaaassssmmmmnnnnttttoooopppptttt((((ssssttttrrrruuuucccctttt mmmmnnnntttteeeennnntttt ****mmmmnnnntttt,,,, cccchhhhaaaarrrr ****oooopppptttt))));;;;
  25.  
  26.      iiiinnnntttt eeeennnnddddmmmmnnnntttteeeennnntttt((((FFFFIIIILLLLEEEE ****ffffiiiilllleeeepppp))));;;;
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      These routines replace the _g_e_t_f_s_e_n_t routines for accessing the file
  30.      system description file /_e_t_c/_f_s_t_a_b.  They are also used to access the
  31.      mounted file system description file /_e_t_c/_m_t_a_b.
  32.  
  33.      _S_e_t_m_n_t_e_n_t opens a file system description file and returns a file pointer
  34.      which can then be used with _g_e_t_m_n_t_e_n_t, _a_d_d_m_n_t_e_n_t, _g_e_t_m_n_t_a_n_y, or
  35.      _e_n_d_m_n_t_e_n_t.  The _t_y_p_e argument is the same as in _f_o_p_e_n(3S).
  36.  
  37.      _G_e_t_m_n_t_e_n_t reads the next line from _f_i_l_e_p and returns a pointer to an
  38.      object with the following structure containing the broken-out fields of a
  39.      line in the filesystem description file, <_m_n_t_e_n_t._h>.  The fields have
  40.      meanings described in _f_s_t_a_b(4).
  41.  
  42.           struct mntent {
  43.                char *mnt_fsname;   /* file system name */
  44.                char *mnt_dir; /* file system path prefix */
  45.                char *mnt_type;     /* dbg, efs, nfs */
  46.                char *mnt_opts;     /* ro, hide, etc. */
  47.                int  mnt_freq; /* dump frequency, in days */
  48.                int  mnt_passno;    /* pass number on parallel fsck */
  49.           };
  50.  
  51.  
  52.      _A_d_d_m_n_t_e_n_t adds the _m_n_t_e_n_t structure _m_n_t to the end of the open file
  53.      _f_i_l_e_p.  Note that _f_i_l_e_p has to be opened for writing if this is to work.
  54.      _A_d_d_m_n_t_e_n_t returns 0 if successful, otherwise it returns 1.
  55.  
  56.      _G_e_t_m_n_t_a_n_y searches the file referenced by _f_p until a match is found
  57.      between a line in the file and _m_p_r_e_f.  _M_p_r_e_f matches the line if all
  58.      non-null entries in _m_p_r_e_f match the corresponding fields in the file.
  59.      Note that option string matching is performed by matching the entire
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTMMMMNNNNTTTTEEEENNNNTTTT((((3333))))                                                      GGGGEEEETTTTMMMMNNNNTTTTEEEENNNNTTTT((((3333))))
  71.  
  72.  
  73.  
  74.      option string, not by matching indivudual option substrings.  If a match
  75.      is found, the matching entry is copied to the area pointed by by _m_p, and
  76.      _g_e_t_m_n_t_a_n_y returns 0.  Otherwise, -1 is returned.
  77.  
  78.      _H_a_s_m_n_t_o_p_t scans the _m_n_t__o_p_t_s field of the _m_n_t_e_n_t structure _m_n_t for a
  79.      substring that matches _o_p_t.  It returns the address of the substring if a
  80.      match is found, 0 otherwise.
  81.  
  82.      _E_n_d_m_n_t_e_n_t closes the file and always returns 1.
  83.  
  84. FFFFIIIILLLLEEEESSSS
  85.      /etc/fstab
  86.      /etc/mtab
  87.  
  88. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  89.      delmntent(3), fstab(4)
  90.  
  91. BBBBUUUUGGGGSSSS
  92.      The returned _m_n_t_e_n_t structure points to static information that is
  93.      overwritten in each call.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.